package com.zff.rental.repository.user;

import com.zff.rental.entity.user.AdministratorEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author HCY
 */
@Repository
public interface AdministratorRepository extends JpaRepository<AdministratorEntity, Long> {

    @Query("SELECT count(*) > 0 FROM AdministratorEntity WHERE userId = :userId")
    boolean isAdmin(Long userId);
}
